package com.klod.data.services


import com.klod.data.mapping.NewsDetailBean
import com.klod.data.mapping.NewsTypeBean
import com.klod.data.repository.NewsRepository
import com.klod.data.repository.NewsRepositoryI
import org.koin.core.annotation.Single

@Single
class NewsServices(
    private val newsRepository: NewsRepository
) : NewsRepositoryI {


    override suspend fun findAllNews(type: String,page:Int ,pageSize:Int) = newsRepository.findAllNews(type,page ,pageSize)

//    override suspend fun findAllNewsByType(type: String) = newsRepository.findAllNewsByType(type)

    override suspend fun findNewsById(id: Int) = newsRepository.findNewsById(id)

    override suspend fun addNews(task: NewsDetailBean) = newsRepository.addNews(task)

    override suspend fun removeNews(id: Int) = newsRepository.removeNews(id)

    override suspend fun types()  = newsRepository.types()


}